-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure we're always including timezone in myPersonalDetails #2040
Conversation
add timezone migration
…ki-dateutils-whitescreen
You can fix your local error by
I am not sure what is wrong with the remote version yet |
@AndrewGable, works on master after running those two commands! 🎉 |
Was still broken on my branch, but should be fixed now 🎉 |
return resolve(); | ||
} | ||
|
||
// Replace the old timezone with the default timezone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @NikkiWines! I'm confused as to why we're setting the old string timezone to the DEFAULT_TIME_ZONE when migrating?
My current understanding is this: the migration isn't supposed to actually change the timezone, it's just meant to change its format so that when you pick it up in DateUtil.js
you can be sure that it's an object (to prevent all that conditional logic you had before when reading it from Onyx). Why would we default it to America/Los Angeles
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point. I opted to use the default because we technically only have half the user's timezone NVP information if it's in string format. We'd be missing the automatic: true/false
portion and using the default value instead just seemed like a simple solution rather than trying to guess half of their NVP value.
However, in retrospect, I think it's fine to use the old timezone
value for timezone.selected
and default to true, since the user can always modify that in their settings in E.cash.
Updated! Also updated the testing steps to include steps for testing the migration |
@NikkiWines I was trying to qa this and I don't think I'm editing correctly the Could you check this string? (It's the last one I tried I tried several possible combinations but all displayed the same error 🤯)
|
@isagoico you were missing quotes around {"login":"[email protected]","avatar":"https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_6.png","displayName":"[email protected]","pronouns":"","timezone":"America/Los_Angeles","firstName":"","lastName":""} |
@NikkiWines I got the correct Onyx Log but I think it broke the page |
Hmm, that's not good. Because that's the error this was intended to fix. Can you show me the results of your It also might useful to retry logging into the same account in incognito mode, to see if the error is reproducable then. Also to be clear have you been able to successfully complete the |
|
I'm getting the same issue in a Incognito window. |
And your |
It displays the OLD format
|
@isagoico you might need to click away from it first, then navigate back to it to see the updated values: I can reproduce this locally, but I'm wondering if it's a function of the way we're testing this. It's weird to me that we run the migration, and I see the updated value in my onyx key (though the default is set to true which makes me think we're overriding it somewhere else) but that we're still getting the formatting error. Seems like a race condition and to be fair most users wouldn't been changing their onyx key |
Either way, I think it would be a pretty small percentage of users who would be experiencing the old timezone issue, since we've had the new timezone format out for a couple of week nows. We're basically manually replicating the old timezone issue to test this. I can make another PR to remove the migration and go back to our old timezone check in DateUtils, but I'm not sure this should block the deploy since I think it would impact a small number of users. |
Ohh I was confused. Before refreshing the page it does display the updated MyPersonalDetails after editing it. After I refreshed and the JS error appears it displayed the OLD MyPersonalDetails. |
OK - here's what's happening so far:
Here's TLDR; of what led up to this.
I'm going to reproduce this error on staging, then let it sit for 30min to confirm that the issue will be resolved after 30min when the |
Hmm, so, unfortunately, looks like things won't self-resolve after 30 minutes, which makes this more serious if someone were to encounter it. I still think the number of users who would meet the criteria is super small, but I'm less hesitant to move ahead with the deploy. Sidenote: weirdly I can only reproduce this issue locally if I have the merge commit checked out. If I try to use the latest master it works without issue. Edit: Looks like it works on master because we modified DateUtils.js to no longer rely on the timezone for |
Retested on staging now that the timezone migration has been removed, no more formatting error + whitescreen Screen.Recording.2021-03-26.at.2.41.51.PM.mov |
@isagoico would you mind going through these steps once more 🦸♀️ To test that personalDetails are getting set correctly:
|
Interesting, I'm unable to reproduce that issue on a new account |
cc: @jasperhuangg since you made this original issue for this one.
Details
Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/158295
Tests
To test that personalDetails are getting set correctly:
To test timezone migration:
myPersonalDetails
myPersonalDetails
so that it's a string like soOLD
NEW
Verbose
[Migrate Onyx] Ran migration ReformatTimezone
logged.myPersonalDetails
onyx key again and confirm it is an object matching the OLD format above.Tested On
Screenshots
No platform-specific changes here, no screenshots necessary.